home *** CD-ROM | disk | FTP | other *** search
- { rect.pas -- Draw a rectangle in a window }
-
- program Rect;
-
- uses WinTypes, WinProcs, WObjects;
-
- type
-
- RectApplication = object(TApplication)
- procedure InitMainWindow; virtual;
- end;
-
- PRectWindow = ^RectWindow;
- RectWindow = object(TWindow)
- procedure Paint(PaintDC: HDC; var PaintInfo: TPaintStruct);
- virtual;
- end;
-
- { RectApplication }
-
- {- Initialize the application's window }
- procedure RectApplication.InitMainWindow;
- begin
- MainWindow := New(PRectWindow, Init(nil, 'Rectangle'))
- end;
-
- { RectWindow }
-
- {- Paint graphics in window }
- procedure RectWindow.Paint(PaintDC: HDC; var PaintInfo:
- TPaintStruct);
- begin
- Rectangle(PaintDC, 10, 10, 100, 100)
- end;
-
- var
-
- RectApp: RectApplication;
-
- begin
- RectApp.Init('RectApp');
- RectApp.Run;
- RectApp.Done
- end.
-
-
- {--------------------------------------------------------------
- Copyright (c) 1991 by Tom Swan. All rights reserved.
- Revision 1.00 Date: 2/20/1990
- ---------------------------------------------------------------}
-
-